#include <cstdio>
#include <algorithm>
using namespace std;
struct people
{
	int id;
	int score;
}p[5005];
int cmp(struct people a, struct people b)
{
	if(a.score > b.score) return 1;
	else if(a.score == b.score && a.id < b.id) return 1;
	else return 0;
}
int main()
{
	freopen("in.txt","r",stdin);
	int n,m;
	scanf("%d %d",&n,&m);
	int num = m * 15 / 10;
	for(int i = 0; i < n; i++)
	{
		scanf("%d %d",&p[i].id,&p[i].score);
	}
	sort(p,p+n,cmp);
	int index = num - 1;
	while (p[index].score == p[index+1].score)
	{
		index = index+1;
	}
	printf("%d %d\n",p[index].score, index + 1);
	for(int i = 0; i <= index; i++)
	{
		printf("%d %d\n",p[i].id,p[i].score);
	}
	return 0;
}
